package com.prepowers.cake;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

import com.prepowers.cake.utils.IDGenerator;


@SpringBootApplication
@EnableAutoConfiguration
public class Application {

	@Autowired
	private Config config;
	
	@Bean(name="userIdGenerator")
	public IDGenerator userIdGenerator(){
		IDGenerator idgen = new IDGenerator(config.getServerId(),0);
		return idgen;
	}
	
    public static void main(String[] args) throws Exception {
        SpringApplication.run(Application.class, args);
    }

}

